﻿#pragma once
/*
 * 版权所�? (c) 纳特通信技�?有限�?�? 2022-2022
 * 功能说明   :
 * 创建日期   : 2022�?05�?13�?
 */

#ifndef __CFGT_UAPI_H__
#define __CFGT_UAPI_H__

#define NLGT_GENL_NAME "nlgt"
#define NLGT_GENL_EVENT_NAME "nlgt_event"

#define NLGT_MULTICAST_GROUP_CONFIG		"config"
#define NLGT_MULTICAST_GROUP_SCAN		"scan"
#define NLGT_MULTICAST_GROUP_REG		"regulatory"
#define NLGT_MULTICAST_GROUP_MLME		"mlme"
#define NLGT_MULTICAST_GROUP_VENDOR		"vendor"
#define NLGT_MULTICAST_GROUP_NAN		"nan"
#define NLGT_MULTICAST_GROUP_TESTMODE	"testmode"

enum nlgt_iftype {
    NLGT_IFTYPE_UNSPECIFIED,
    NLGT_IFTYPE_G,
    NLGT_IFTYPE_T,
    NLGT_IFTYPE_MONITOR,

    /* keep last */
    NUM_NLGT_IFTYPES,
    NLGT_IFTYPE_MAX = NUM_NLGT_IFTYPES - 1
};


enum nlgt_chan_width {
    NLGT_CHAN_WIDTH_20,
    NLGT_CHAN_WIDTH_40,
    NLGT_CHAN_WIDTH_60,
    NLGT_CHAN_WIDTH_80,
    NLGT_CHAN_WIDTH_100,
};

enum nlgt_commands {
    /* don't change the order or add anything between, this is ABI! */
    NLGT_CMD_UNSPEC,
    NLGT_CMD_ECHO,
    NLGT_CMD_REPLY_ERR,

    NLGT_CMD_GET_GTPHY,
    NLGT_CMD_SET_GTPHY,
    NLGT_CMD_NEW_GTPHY,
    NLGT_CMD_DEL_GTPHY,

    NLGT_CMD_GET_INTERFACE,  /* can dump */
    NLGT_CMD_SET_INTERFACE,
    NLGT_CMD_NEW_INTERFACE,
    NLGT_CMD_DEL_INTERFACE,

    NLGT_CMD_SET_CHANNEL,    /* with bw */
    NLGT_CMD_SET_BSS,
    NLGT_CMD_CONFIG,
    NLGT_CMD_START_AP,
    NLGT_CMD_STOP_AP,
    NLGT_CMD_SET_BEACON,

    NLGT_CMD_ADD_USER,
    NLGT_CMD_DEL_USER,
    NLGT_CMD_KICK_USER,

    NLGT_CMD_DEV_STATE_CHANGE,

    NLGT_CMD_SET_KEY,
    NLGT_CMD_GET_KEY,
    NLGT_CMD_DEL_KEY,

    NLGT_CMD_GET_SCAN,
    NLGT_CMD_TRIGGER_SCAN,
    NLGT_CMD_NEW_SCAN_RESULTS,
    NLGT_CMD_CONNECT_RESULTS,
    NLGT_CMD_SCAN_ABORTED,
    NLGT_CMD_ABORT_SCAN,

    NLGT_CMD_CONNECT,
    NLGT_CMD_DISCONNECT,

    NLGT_CMD_GET_SURVEY,
    NLGT_CMD_NEW_SURVEY_RESULTS,

    NLGT_CMD_FRAME,
    NLGT_CMD_ACTION,
    NLGT_CMD_REGISTER_FRAME,

    /* acn begin */
    NLGT_CMD_ENABLE_VENDOR_IE,
    NLGT_CMD_DISABLE_VENDOR_IE,
    NLGT_CMD_MGMT_TX,
    NLGT_CMD_MGMT_RX,
    /* acn end */
    NLGT_CMD_RSP,

    NLGT_CMD_TEST,

    /* add new commands above here */

    /* used to define NLGT_CMD_MAX below */
    __NLGT_CMD_AFTER_LAST,
    NLGT_CMD_MAX = __NLGT_CMD_AFTER_LAST - 1
};

enum nlgt_attrs {
    /* don't change the order or add anything between, this is ABI! */
    NLGT_ATTR_UNSPEC,

    NLGT_ATTR_MSG,
    NLGT_ATTR_MEM,

    NLGT_ATTR_GTPHY,
    NLGT_ATTR_GTPHY_NAME,
    NLGT_ATTR_IFACE_SOCKET_OWNER,
    NLGT_ATTR_CONTROL_PORT_OVER_NLGT,

    NLGT_ATTR_MNTR_FLAGS,      /* for monitor mode */
    NLGT_MNTR_FLAG_COOK_FRAMES,

    NLGT_ATTR_IFINDEX,
    NLGT_ATTR_IFNAME,
    NLGT_ATTR_IFTYPE,

    NLGT_ATTR_FREQ,
    NLGT_ATTR_CHANNEL,
    NLGT_ATTR_CHANNEL_WIDTH,
    NLGT_ATTR_MAC,
    NLGT_ATTR_IE,

    NLGT_ATTR_KEY_DATA,
    NLGT_ATTR_KEY_IDX,
    NLGT_ATTR_KEY_CIPHER,
    NLGT_ATTR_KEY_SEQ,
    NLGT_ATTR_KEY_DEFAULT,

    NLGT_ATTR_FRAME,
    NLGT_ATTR_FRAME_TYPE,

    NLGT_ATTR_SSID,
    NLGT_ATTR_BSSID,
    NLGT_ATTR_CELLID,
    NLGT_ATTR_CP_TYPE,
    NLGT_ATTR_SYSMSG_PERIOD,
    NLGT_ATTR_SCFG_IDX,
    NLGT_ATTR_CC_START_POS,
    NLGT_ATTR_BEACON_INTERVAL,
    NLGT_ATTR_REASON_CODE,
    NLGT_ATTR_GTPHY_SYMBOL_TYPE,  /* GT symbol type */

    NLGT_ATTR_SCAN_FREQUENCIES,
    NLGT_ATTR_SCAN_SSIDS,
    NLGT_ATTR_GENERATION,
    NLGT_ATTR_BSS,
    NLGT_ATTR_SCAN_FLAGS,

    NLGT_ATTR_KEY_TYPE,
    NLGT_ATTR_KEY,

    NLGT_ATTR_RSP_RESULT,

    /* add attributes here, update the policy in nlgt.c */

    __NLGT_ATTR_AFTER_LAST,
    NUM_NLGT_ATTR = __NLGT_ATTR_AFTER_LAST,
    NLGT_ATTR_MAX = __NLGT_ATTR_AFTER_LAST - 1
};

enum nlgt_key_mode {
    NLGT_KEY_RX_TX,
    NLGT_KEY_NO_TX,
};

#define NLGT_GTPHY_NAME_MAXLEN  64

#endif
